Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue RE: Paperclip, Azure EOL, rest client, etc #30352

Open
mjankowski opened this issue May 17, 2024 · 7 comments
Open

Tracking issue RE: Paperclip, Azure EOL, rest client, etc #30352

mjankowski opened this issue May 17, 2024 · 7 comments
Labels
suggestion Feature suggestion

Comments

@mjankowski
Copy link
Contributor

mjankowski commented May 17, 2024

Background

  • For file attachment on various DB models throughout the app, Mastodon relies on paperclip
  • With the introduction of Rails activestorage solution, the original paperclip gem was deprecated in 2018
  • There is a kt-paperclip fork that is more or less maintained, and which Mastodon now uses instead of paperclip
  • We support various storage backends, including Azure
  • For azure specifically, we rely on md-paperclip-azure which is itself a fork of the orignal paperclip-azure gem (not updated in ~5 years) and provides an interface between paperclip and the official azure gem.

Issues

  • The situation where we are using a fork of an unmaintained adapter (azure) to interface with a fork of an unmaintained gem (paperclip) feels a bit precarious, but the migration from paperclip to AS would be one of the more substantial code and data/storage migrations we've attempted both on dev side and on instance admin side.
  • The azure-storage-ruby gem will be retired in Sep 2024, in favor of using the REST api directly.
  • The azure-storage-common gem is our last remaining gem with a hard version lock to faraday 1.x, which prevents updating there.
@mjankowski mjankowski added the suggestion Feature suggestion label May 17, 2024
@mjankowski
Copy link
Contributor Author

Maybe relevant - rails/rails#49983 (comment) - someone is working on a replacement gem for azure/activestorage which sounds like it will implement just the subset of the Azure REST API that is needed by AS.

This might be good to either use directly or build a paperclip adapter on top of.

@JoeDupuis
Copy link

I would need to look at kt-paperclip after I am done with AS, I could look into making the gem work for paperclip too. I don't think it would be hard to support both 🤔
I might need to find a more generic name for the gem though 😆

@renchap
Copy link
Sponsor Member

renchap commented May 20, 2024

@JoeDupuis I have not looked at your code yet, but maybe you could have a gem that implements the required Azure API calls (simple-azure-storage?), and a second one to interface it with AS (simple-azure-storage-activestorage), and we build our own simple-azure-storage-paperclip?

@JoeDupuis
Copy link

JoeDupuis commented May 21, 2024

I renamed the Gem to azure-blob-storage. It's pretty close to azure-storage-blob. It might change again if Rails core think it's a problem.
Nothing in it make it specific to Active Storage.

@renchap
Copy link
Sponsor Member

renchap commented May 21, 2024

Link to azure-blob-storage: https://github.com/JoeDupuis/azure-blob-storage

@JoeDupuis
Copy link

After discussing it internally, I will be renaming it to azure-blob later tonight. It's too close to the existing gem name.
Sorry for the flip flop.

It should make it easier to use too (shorter namespace).

@JoeDupuis
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

3 participants